home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Compilers / digital marsC compier / dm / include / Process.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-16  |  4.8 KB  |  168 lines

  1. /* Copyright (C) 1992-2001 by Digital Mars. $Revision: 1.1.1.1 $ */
  2. #if __SC__ || __RCC__
  3. #pragma once
  4. #endif
  5.  
  6. #ifndef __PROCESS_H
  7. #define __PROCESS_H 1
  8.  
  9. #if __cplusplus
  10. extern "C" {
  11. #endif
  12.  
  13. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  14. #ifndef _CRTAPI1
  15. #define _CRTAPI1 __cdecl
  16. #endif
  17.  
  18. /* Define _CRTAPI2 (for compatibility with the NT SDK) */
  19. #ifndef _CRTAPI2
  20. #define _CRTAPI2 __cdecl
  21. #endif
  22.  
  23. /* Define CRTIMP */
  24. #ifndef _CRTIMP
  25. #if defined(_WIN32) && defined(_DLL)
  26. #define _CRTIMP  __declspec(dllimport)
  27. #else
  28. #define _CRTIMP
  29. #endif
  30. #endif
  31.  
  32. #if __OS2__ && __INTSIZE == 4
  33. #define __CLIB __stdcall
  34. #else
  35. #define __CLIB __cdecl
  36. #endif
  37.  
  38. #if !defined(_WCHAR_T_DEFINED)
  39. typedef unsigned short wchar_t;
  40. #define _WCHAR_T_DEFINED 1
  41. #endif
  42.  
  43. #ifdef _WINDOWS
  44.           void __CLIB _exec_showset(unsigned short style);
  45.           void __CLIB _exec_showreset(void);
  46. unsigned short __CLIB _exec_showget(void);
  47. #endif
  48.  
  49. void __CLIB exit(int);
  50. void __CLIB _c_exit(void);
  51. void __CLIB _cexit(void);
  52. void __CLIB _exit(int);
  53. void __CLIB abort(void);
  54. void __CLIB _dodtors(void);
  55. #if !(M_UNIX || M_XENIX)
  56. int __CLIB getpid(void);
  57. #endif
  58. #define _getpid getpid
  59.  
  60. int __CLIB system(const char *);
  61.  
  62. int __CLIB spawnl(int,const char *,const char *,...);
  63. int __CLIB spawnle(int,const char *,const char *,...);
  64. int __CLIB spawnlp(int,const char *,const char *,...);
  65. int __CLIB spawnlpe(int,const char *,const char *,...);
  66. int __CLIB spawnv(int,const char *,const char *const *);
  67. int __CLIB spawnve(int,const char *,const char *const *,const char *const *);
  68. int __CLIB spawnvp(int,const char *,const char *const *);
  69. int __CLIB spawnvpe(int,const char *,const char *const *, const char *const *);
  70.  
  71. #define _spawnl   spawnl
  72. #define _spawnle  spawnle
  73. #define _spawnlp  spawnlp
  74. #define _spawnlpe spawnlpe
  75. #define _spawnv   spawnv
  76. #define _spawnve  spawnve
  77. #define _spawnvp  spawnvp
  78. #define _spawnvpe spawnvpe
  79.  
  80. #define P_WAIT    0
  81. #define P_NOWAIT  1
  82. #define P_OVERLAY 2
  83.  
  84. #define _P_WAIT    P_WAIT
  85. #define _P_NOWAIT  P_NOWAIT
  86. #define _P_OVERLAY P_OVERLAY
  87.  
  88. #if !(M_UNIX || M_XENIX)
  89. int __CLIB execl(const char *,const char *,...);
  90. int __CLIB execle(const char *,const char *,...);
  91. int __CLIB execlp(const char *,const char *,...);
  92. int __CLIB execlpe(const char *,const char *,...);
  93. int __CLIB execv(const char *,const char *const *);
  94. int __CLIB execve(const char *,const char *const *,const char *const *);
  95. int __CLIB execvp(const char *,const char *const *);
  96. int __CLIB execvpe(const char *,const char *const *,const char *const *);
  97. #endif
  98. #define _execl execl
  99. #define _execle execle
  100. #define _execlp execlp
  101. #define _execlpe execlpe
  102. #define _execv execv
  103. #define _execve execve
  104. #define _execvp execvp
  105. #define _execvpe execvpe
  106.  
  107. #define WAIT_CHILD 0
  108. #define WAIT_GRANDCHILD 1
  109.  
  110. int __CLIB cwait(int *,int,int);
  111. int __CLIB wait(int *);
  112.  
  113. #ifdef _MT
  114. #if __NT__
  115.  
  116.  
  117. unsigned long __CLIB _beginthread(void (__CLIB *)(void *),unsigned,void *);
  118. unsigned long __CLIB _beginthreadex(void *, unsigned,
  119.                 unsigned (__stdcall *) (void *), void *, unsigned, unsigned *);
  120. void __CLIB _endthread(void);
  121. void __CLIB _endthreadex(unsigned);
  122.  
  123. #elif __INTSIZE == 4
  124.  
  125. int __CLIB _beginthread(void (__CLIB *)(void *),unsigned,void *);
  126. void __CLIB _endthread(void);
  127.  
  128. #else
  129. int __CLIB _beginthread(void (__far *)(void __far *),
  130.        void __far *, unsigned,void __far *);
  131. void __CLIB _endthread(void);
  132.  
  133. #endif
  134. #endif
  135.  
  136. #if defined(_WIN32)
  137. int __stdcall _CRT_INIT(void *,unsigned long,void *);
  138. #endif
  139.  
  140. #ifdef __NT__
  141. int __CLIB _wsystem(const wchar_t *);
  142. int __CLIB _wspawnl(int, const wchar_t *, const wchar_t *, ...);
  143. int __CLIB _wspawnle(int, const wchar_t *, const wchar_t *, ...);
  144. int __CLIB _wspawnlp(int, const wchar_t *, const wchar_t *, ...);
  145. int __CLIB _wspawnlpe(int, const wchar_t *, const wchar_t *, ...);
  146. int __CLIB _wspawnv(int, const wchar_t *, const wchar_t * const *);
  147. int __CLIB _wspawnve(int, const wchar_t *, const wchar_t * const *, const wchar_t * const *);
  148. int __CLIB _wspawnvp(int, const wchar_t *, const wchar_t * const *);
  149. int __CLIB _wspawnvpe(int, const wchar_t *, const wchar_t * const *, const wchar_t * const *);
  150. #if !(M_UNIX || M_XENIX)
  151. int __CLIB _wexecl(const wchar_t *, const wchar_t *, ...);
  152. int __CLIB _wexecle(const wchar_t *, const wchar_t *, ...);
  153. int __CLIB _wexeclp(const wchar_t *, const wchar_t *, ...);
  154. int __CLIB _wexeclpe(const wchar_t *, const wchar_t *, ...);
  155. int __CLIB _wexecv(const wchar_t *, const wchar_t * const *);
  156. int __CLIB _wexecve(const wchar_t *, const wchar_t * const *, const wchar_t * const *);
  157. int __CLIB _wexecvp(const wchar_t *, const wchar_t * const *);
  158. int __CLIB _wexecvpe(const wchar_t *, const wchar_t * const *, const wchar_t * const *);
  159. #endif
  160. #endif
  161.  
  162. #ifdef __cplusplus
  163. }
  164. #endif
  165.  
  166.  
  167. #endif
  168.